<?php
/**
 * Description of ModelTestCase
 *
 * @author christ
 */
class ModelTestCase
    extends PHPUnit_Framework_TestCase
{
    /**
     *
     * @var \Bisna\Application\Container\DoctrineContainer
     */
    protected $doctrineContainer;
    protected $application;
    public function setUp()
    { 
        $this->application = new Zend_Application(
                APPLICATION_ENV,
                APPLICATION_PATH . '/configs/application.ini');
        $this->application->bootstrap();
        $this->doctrineContainer = Zend_Registry::get('doctrine');
        $em = $this->doctrineContainer->getEntityManager();
        $tool = new \Doctrine\ORM\Tools\SchemaTool($em);
        $tool->dropDatabase();
        $tool->createSchema($em->getMetadataFactory()->getAllMetadata());
        parent::setUp();
    }
    public function tearDown()
    {
        $this->doctrineContainer->getConnection()->close();
        //$em = $this->doctrineContainer->getEntityManager();
        //$tool = new \Doctrine\ORM\Tools\SchemaTool($em);
        //$tool->dropDatabase();
        parent::tearDown();
    }
}

